Page({
  data: {
    VistorList: [],
  },
  goPassport(e) {
    console.log(e);
    if (e.mark.status === 0) return wx.utils.toast('此通行证已失效！')
    wx.navigateTo({
      url: '/visitor_pkg/pages/passport/index?id=' + e.mark.id,
    })
  },
  onShow() {
    this.getVistorList()
  },
  //获取访客邀请列表
  async getVistorList() {
    const res = await wx.http.get('/visitor', { current: 1, pageSize: 10 })
    // console.log(res.data.rows);
    this.setData({
      VistorList: res.data.rows
    })
  }
})
